<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">  
    <meta name = "format-detection" content = "telephone=no"> 
    <title>支付</title>
    <link rel="stylesheet" href="/Public/Home/css/memberOrder.css">
    <style>
        html,body{
            height: 100%;
            background: white;
        }
    </style>
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
    <script>
        window.localStorage.setItem('isThrough',null);
    </script>
</head>
<body>
    <input type="hidden" id="time_date" value="<?php echo ($time); ?>">
    <div class="warp">
        <div class="count-down">
            <h4>剩余支付时间</h4>
            <div class="count-time"><span class="hour_show"></span>:<span class="minute_show"></span>:<span class="second_show"></span></div>
            <div class="refund-mes-title">
                应付金额：
                <span>￥<?php echo ($order_data['total_amount']); ?></span>
            </div>
        </div>
        <div class="payment-line"></div>
        <!-- 支付方式 -->
        <div class="pay-method">
            <h3>支付方式</h3>
            <ul id="payment">
                <li data-type="1"><img src="/Public/Home/images/wx-pay.png" alt=""><span>微信支付</span></li>
                <!--<li data-type="2"><img src="/Public/Home/images/yzf-pay.png" alt=""><span>翼支付</span></li>
                <li data-type="3"><img src="/Public/Home/images/kq-pay.png" alt=""><span>块钱支付</span></li>-->
                <!--<li data-type="4"><img src="/Public/Home/images/yijifu-pay.png" alt=""><span>易极付</span></li>-->
            </ul>
        </div>
        <div class="pay-but">
            <p class="mgTop"><a href="javascript:void(0) " onclick="_click()" class="btn btn-red btn-block">立即支付</a></p>
        </div>
       </div>
    <?php if($type){ $wx_url = U('Member/doPayOrder',['order_id' => $order_id,'type' => 1]); }else{ $wx_url = U('Member/doPayOrder',['order_id' => $order_id]); } ?>

    <script type="text/javascript">
		require(['memberPayment']);

        function _click(){
            var payment;
            var flag = false;
            var dtype = 0;
            $('#payment li').each(function(i, o){
                //查找class中是否有active
                if($(this).hasClass("active")){
                    flag = true;
                    //dtype = $(this).attr("data-type");
                    dtype = $(this).data("type");
                }
            });
            //alert(dtype);
            if(!flag){
                alert('请选择支付方式！');
                return;
            }

            switch (dtype){
                //微信
                case 1 : window.location.href="<?php echo ($wx_url); ?>?pay_id=1";return;
                //翼支付
                //case '2' : window.location.href="<?php echo U('Pay/weixinpay'),['id' => $order_data['order_num']];?>";break;
                //块钱支付
                //case '3' : window.location.href="<?php echo U('Pay/weixinpay'),['id' => $order_data['order_num']];?>";break;
                //易极付
                case 4 : window.location.href="<?php echo ($wx_url); ?>?pay_id=4";break;
                default : alert('无效支付！');return;
            }


        }
	</script>
</body>
</html>